A Fabry-Perot interferometer comprises a first semi-transparent mirror and a second semi-transparent mirror, which are arranged to form an optical cavity. The Fabry-Perot interferometer may provide one or more transmission peaks. The spectral position of a transmission peak may be changed by changing the distance between the mirrors. The distance between the mirrors may be called as the mirror gap or as the mirror spacing. Performing a spectral measurement may comprise determining the spectral position of the transmission peak. The interferometer may comprise a capacitive sensor for monitoring the adjustable mirror gap. The spectral position of a transmission peak of the interferometer may be determined by e.g. monitoring the capacitance of the capacitive sensor.